# Maintainer: taozuhong <taozuhong@gmail.com>

_realname=live-chart
pkgbase=mingw-w64-${_realname}-gtk3
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-gtk3"
pkgver=1.9.1
pkgrel=1
pkgdesc="Live Chart is a real-time charting library for GTK3 and Vala, based on Cairo. (mingw-w64)"
arch=(any)
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/lcallarec/live-chart"
license=('spdx:MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
             "${MINGW_PACKAGE_PREFIX}-meson"
             "${MINGW_PACKAGE_PREFIX}-ninja"
             "${MINGW_PACKAGE_PREFIX}-pkgconf"
             "${MINGW_PACKAGE_PREFIX}-vala"
             "${MINGW_PACKAGE_PREFIX}-python")
depends=("${MINGW_PACKAGE_PREFIX}-glib2"
         "${MINGW_PACKAGE_PREFIX}-gtk3"
         "${MINGW_PACKAGE_PREFIX}-libgee")
source=(https://github.com/lcallarec/${_realname}/archive/${pkgver}/${_realname}-${pkgver}.tar.gz)
sha256sums=('7b5f1d0807b5f6e8b09e2c1dd468af22379578b55b38afd530c0ff006bc33e53')

build() {
  mkdir "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}

  MSYS2_ARG_CONV_EXCL="--prefix=" \
  ${MINGW_PREFIX}/bin/meson setup \
    --prefix="${MINGW_PREFIX}" \
    --buildtype=plain \
    ../${_realname}-${pkgver}

  ${MINGW_PREFIX}/bin/meson compile
}

package() {
  cd "${srcdir}"/build-${MSYSTEM}
  DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/meson install
}
